package date1127.multilanguage;

import java.util.Date;
import java.util.Locale;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.lu.jdog.util.Resource;

public class MultiTest {
	private static ApplicationContext applicationContext;

	public static void main(String[] args) {
		applicationContext = new ClassPathXmlApplicationContext(Resource.getAssertPath(MultiTest.class, "beans.xml"));
		
		String[] reader = {"读者"};
		
		// 使用 getMessage 方法获取本地化消息。Locale 的 getDefault 方法
		// 返回计算机环境的默认 Locale
		String hello = applicationContext.getMessage("hello",reader, Locale.getDefault());
		System.out.println(hello);

		Object[] b = { new Date() };//文件中配置的参数数组。配置形如{0},{1}
		String now = applicationContext.getMessage("now", b, Locale.getDefault());
		System.out.println(now);
		
	}
}
